<template>
  <div class="wrap">
    <div class="top1">
      <div class="left">
        <p>左</p>
      </div>
      <div class="right">
        <dl>
          <dt><img src="http://localhost:8888/h.png" alt="" /></dt>
          <dd>
            <p>观看人数</p>
            <p><b>1740</b></p>
          </dd>
        </dl>
        <dl>
          <dt><img src="http://localhost:8888/hh.png" alt="" /></dt>
          <dd>
            <p>最高在线人</p>
            <p><b>4000</b></p>
          </dd>
        </dl>
        <dl>
          <dt><img src="http://localhost:8888/hhh.png" alt="" /></dt>
          <dd>
            <p>新增粉丝</p>
            <p><b>578</b></p>
          </dd>
        </dl>
        <dl>
          <dt><img src="http://localhost:8888/hhhh.png" alt="" /></dt>
          <dd>
            <p>购买人数</p>
            <p><b>3220</b></p>
          </dd>
        </dl>
      </div>
    </div>
    <div class="top2">
      <div id="main" style="width: 600px; height: 400px"></div>
      <div id="mains" style="width: 600px; height: 400px"></div>
    </div>
    <div class="top3">
      <el-table :data="this.list" style="width: 95%">
        <el-table-column label="商品图">
          <template slot-scope="scope">
            <img :src="scope.row.image" alt="" style="height: 100px" />
          </template>
        </el-table-column>
        <el-table-column prop="name" label="选中" width="150">
        </el-table-column>
        <el-table-column prop="name" label="名称" width="150">
        </el-table-column>
        <el-table-column prop="title" label="描述" width="150">
        </el-table-column>
        <el-table-column prop="price" label="价钱" width="150">
        </el-table-column>
      </el-table>
    </div>
  </div>
</template>

<script>
import axios from "axios";
import * as echarts from "echarts";
export default {
  data() {
    return {
      list: [],
    };
  },
  created() {
    axios.get("/gethuo").then((res) => {
      this.list = res.data;
      console.log(this.list, "list");
    });
  },
  mounted() {
    var chartDom = document.getElementById("main");
    var myChart = echarts.init(chartDom);
    var option;

    var chartDom1 = document.getElementById("mains");
    var myChart1 = echarts.init(chartDom1);
    var option1;

    option = {
      xAxis: {
        type: "category",
        data: ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"],
      },
      yAxis: {
        type: "value",
      },
      series: [
        {
          data: [150, 230, 224, 218, 135, 147, 260],
          type: "line",
        },
      ],
    };

    option1 = {
      xAxis: {
        type: "category",
        data: ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"],
      },
      yAxis: {
        type: "value",
      },
      series: [
        {
          data: [150, 230, 224, 218, 135, 147, 260],
          type: "line",
        },
      ],
    };

    option && myChart.setOption(option);
    option && myChart1.setOption(option1);
  },
};
</script>

<style lang="scss" scoped>
.wrap {
  .top1 {
    width: 100%;
    height: 270px;
    /*  background: red; */
    display: flex;
    .left {
      width: 35%;
      height: 100%;
      background: slateblue;
    }
    .right {
      width: 65%;
      height: 100%;
      /* background: skyblue; */
      display: flex;
      dl {
        box-shadow: 0px 0px 8px #9d9d9d;
        border-radius: 10px;
        width: 150px;
        height: 120px;
        background: #fff;
        margin-left: 100px;
        margin-top: 60px;
        border-radius: 10px;
        b {
          font-size: 25px;
          color: #4495fb;
        }
        dt {
          width: 100%;
          text-align: center;
          height: 45%;
        }
        dd {
          width: 100%;
          height: 55%;
          text-align: center;
        }
      }
    }
  }
  .top2 {
    display: flex;
    margin-top: 30px;
    #main {
      margin-left: 100px;
      box-shadow: 0px 0px 8px #9d9d9d;
      border-radius: 4px;
    }
    #mains {
      margin-left: 200px;
      box-shadow: 0px 0px 8px #9d9d9d;
      border-radius: 4px;
    }
  }
  .top3 {
    margin-left: 100px;
    width: 90%;
    height: 200px;
    margin-top: 20px;
  }
}
</style>